correct several minor language violations. From Bruce Thompson and myself...
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 15 Jul 2003 16:36:20 +0000 (16:36 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 15 Jul 2003 16:36:20 +0000 (16:36 +0000)
gpsbabel/garmin.c
gpsbabel/gpilots.c
gpsbabel/magproto.c
gpsbabel/mapsend.c
gpsbabel/quovadis.c

index 9442d8a9bb9db1deb86f277aeb34d00144fa7035..50f0b3c553edf7c877a01c976007d3412da3a9dc 100644 (file)
@@ -88,7 +88,7 @@ waypt_read(void)
                 * all the cases here.     Yes, libjeeps should probably 
                 * do this and not us...
                 */
-               if ((way[i]->alt == (float) (1<<31)) || 
+               if ((way[i]->alt == (float) (1U<<31)) || 
                     (way[i]->alt == INT_MAX) ||
                     (way[i]->alt == 1.0e25)
                     ) {
index e84ea4f1b2ab14c2155e913265de700526e734a9..deeef52815beb7aa0fc175d0905c8fc503d087cd 100644 (file)
@@ -43,11 +43,11 @@ Semicircle_Type;
 
 typedef struct
 {
-       unsigned char ident[6];         /* identifier */
+       char ident[6];                  /* identifier */
        unsigned char lat[4];           /* position */
        unsigned char lon[4];           /* position */
        unsigned char unused[4];        /* should be set to zero */
-       unsigned char cmnt[40];         /* comment */
+       char cmnt[40];                  /* comment */
        unsigned char smbl;             /* symbol id */
        unsigned char dspl;             /* display option */
 } D103_Wpt_Type;
@@ -103,7 +103,7 @@ struct record
 #if LATER
                Custom_Rte_Hdr_Type CustRteHdr;
 #endif
-       };
+       } wpt;
 };
 
 
@@ -251,14 +251,14 @@ data_read(void)
                         * G103Type
                         */
                        case 4:
-                               wpt_tmp->shortname = xstrndupt(rec->d103.cmnt, sizeof(rec->d103.ident));
-                               wpt_tmp->description = xstrndupt(rec->d103.cmnt, sizeof(rec->d103.cmnt));
+                               wpt_tmp->shortname = xstrndupt(rec->wpt.d103.cmnt, sizeof(rec->wpt.d103.ident));
+                               wpt_tmp->description = xstrndupt(rec->wpt.d103.cmnt, sizeof(rec->wpt.d103.cmnt));
                                /* This is odd.   This is a Palm DB file,
                                 * yet the data appears to be little endian,
                                 * not appropriate the the actual Palm.
                                 */
-                               lon = le_read32(&rec->d103.lon);
-                               lat = le_read32(&rec->d103.lat);
+                               lon = le_read32(&rec->wpt.d103.lon);
+                               lat = le_read32(&rec->wpt.d103.lat);
                                wpt_tmp->position.longitude.degrees = lon / 2147483648.0 * 180.0;
                                wpt_tmp->position.latitude.degrees = lat / 2147483648.0 * 180.0;
                                waypt_add(wpt_tmp);
@@ -269,9 +269,9 @@ data_read(void)
                        case 101:
                                track_head = route_head_alloc();
                                route_add_head(track_head);
-                               track_head->rte_name = xstrndup(rec->CustTrkHdr.name, sizeof(rec->CustTrkHdr.name));
-                               sz = be_read32(&rec->CustTrkHdr.number);
-                               tp = (Custom_Trk_Point_Type *) ((char *) pdb_rec->data + sizeof(rec->CustTrkHdr));
+                               track_head->rte_name = xstrndup(rec->wpt.CustTrkHdr.name, sizeof(rec->wpt.CustTrkHdr.name));
+                               sz = be_read32(&rec->wpt.CustTrkHdr.number);
+                               tp = (Custom_Trk_Point_Type *) ((char *) pdb_rec->data + sizeof(rec->wpt.CustTrkHdr));
                                /* FIXME: This is incomplete and probably wrong */
                                while (sz--) {
                                        wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
index 0b04901326e6ca89fe4838e413f9f2561bdfa075..c23ea016771909c422ea5c7b34d80a4fadad429e 100644 (file)
@@ -1304,7 +1304,7 @@ mag_route_trl(const route_head * rte)
 }
 
 static void
-mag_route_hdr()
+mag_route_hdr(const route_head *rh)
 {
 }
 
index f0dba1a569e5a62ae6f22b7fc7390a6c5ac4affa..65691bec263e3e38cb90cf89d858830662f9a0b7 100644 (file)
@@ -152,7 +152,7 @@ size_t
 my_fwrite4(int *ptr, FILE *stream)
 {
        unsigned char cbuf[4];
-       unsigned char *cptr = (char *) ptr;
+       unsigned char *cptr = (unsigned char *) ptr;
 
        if (!endianness_tested) {
                test_endianness();
@@ -474,7 +474,7 @@ mapsend_route_hdr(const route_head *rte)
 }
 
 static void 
-mapsend_noop()
+mapsend_noop(const route_head *wp)
 {
        /* no-op */
 }
index 669786ced97d224133881caa164b44529b235aa1..12a9a6a7b6fccf7374383f6d82d02b91d033843b 100644 (file)
@@ -27,8 +27,8 @@ static const char *out_fname;
 struct pdb *opdb;
 
 static int ct;
-static char* rec_ptr = NULL;
-static char* current_rec = NULL;
+static ubyte* rec_ptr = NULL;
+static ubyte* current_rec = NULL;
 static int rec_index = 0;
 
 static char *dbname = NULL;
@@ -72,10 +72,10 @@ static int wpt_to_icon(geocache_type        type) {
     }
     return QUESTION_ICON;
 }
-
+#if 0
 static void
-docopy(char*           dest,
-       const char*     src,
+docopy(ubyte*          dest,
+       const ubyte*    src,
        const int       size)
 {
     int i;
@@ -83,6 +83,7 @@ docopy(char*          dest,
        dest[i] = src[i];
     }
 }
+#endif
 
 static void
 rd_init(const char *fname, const char *args)
@@ -173,7 +174,7 @@ quovadis_writewpt(waypoint *wpt)
     int        i;
 
     if (current_rec == NULL) {
-       char dummy = 0;
+       ubyte dummy = 0;
        struct pdb_record *pdb_rec;
        pdb_rec = new_Record(0, 0, ct++, 1, &dummy);
        if (pdb_rec == NULL) {
@@ -208,7 +209,7 @@ quovadis_writewpt(waypoint *wpt)
        rec->reserved[i] = 0;
     }
 
-    docopy(rec_ptr, (const char*)rec, sizeof(*rec));
+    memcpy(rec_ptr, rec, sizeof(*rec));
     rec_ptr += sizeof(*rec);
     rec_index += 1;
     xfree(rec);